<template>
  <div class="chongzhi">
    <div class="chongzhiWrap">
      <p class="desc">
        充值成为小乐课堂会员，可以让您的孩子在会员期间免费参加课程培训。其中，会员天数自您正式上课时，才开始扣除。
      </p>
      <img src="http://7xnjhz.com1.z0.glb.clouddn.com/VIP.png?imageMogr2/auto-orient/strip" alt="">
      <div class="chongzhiTypes clear">
        <span class="fl"><i class="radio"></i>会员天数30天</span>
        <span class="fr">¥388</span>
      </div>
      <a @click="doSubmit" class="submit">付款</a>
    </div>
  </div>
</template>
<script type="text/babel">
  import {submit} from '../factory/pay';
  export default {
    name: 'pay',
    components: {
      vfooter: require('../components/vfooter')
    },
    data () {
      return {
      };
    },
    created () {
      this.$dispatch('alert.close');
    },
    methods: {
      doSubmit () {
        submit().then(res => {
          if (!res.iserror) {
            this.$dispatch('alert', '操作成功~', () => {
              this.$router.go({name: 'uc'});
            });
          }
        });
      }
    }
  };
</script>
